package package1;

import java.util.Map;

public class TestForThread {

	public static void main(String[] args) {
		String a = Thread.currentThread().getStackTrace()[1].getClassName();
		System.err.println(a);
		
		Map<Thread, StackTraceElement[]> b = Thread.getAllStackTraces();
		for(Thread c:b.keySet()){
			print(c);
		}
			
		System.err.println(a);
	}
	private static void print(Thread c) {
		System.err.println("ThreadName:"+c.getName());
	}

}
